package com.wangsd.web.report.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 商户配置
 */
@Data
@Entity
@Table(name = "merchant")
@ApiModel(value = "商户", description = "商户配置信息")
public class Merchant implements Serializable {

    @ApiModelProperty(value = "商户名称")
    private String name;

    @ApiModelProperty(value = "商户号")
    private String subMchId;

    @ApiModelProperty(value = "服务商ID")
    private Long serviceBusinessId;
    /**
     * 以下是通用字段
     */
    @Id
    @TableId(type = IdType.AUTO)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private Date createdTime;

    @ApiModelProperty(value = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updatedTime;

    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    private Integer deleted;

    @ApiModelProperty(value = "检索标识")
    private String code;

    /**
     * 扩展字段
     */

    @ApiModelProperty(value = "服务商名称")
    @Transient
    @TableField(exist = false)
    private String businessName;
}
